﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.CullingGroupEvent
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

#nullable disable
namespace UnityEngine
{
  /// <summary>
  ///   <para>Provides information about the current and previous states of one sphere in a CullingGroup.</para>
  /// </summary>
  public struct CullingGroupEvent
  {
    private int m_Index;
    private byte m_PrevState;
    private byte m_ThisState;
    private const byte kIsVisibleMask = 128;
    private const byte kDistanceMask = 127;

    /// <summary>
    ///   <para>The index of the sphere that has changed.</para>
    /// </summary>
    public int index => this.m_Index;

    /// <summary>
    ///   <para>Was the sphere considered visible by the most recent culling pass?</para>
    /// </summary>
    public bool isVisible => ((uint) this.m_ThisState & 128U) > 0U;

    /// <summary>
    ///   <para>Was the sphere visible before the most recent culling pass?</para>
    /// </summary>
    public bool wasVisible => ((uint) this.m_PrevState & 128U) > 0U;

    /// <summary>
    ///   <para>Did this sphere change from being invisible to being visible in the most recent culling pass?</para>
    /// </summary>
    public bool hasBecomeVisible => this.isVisible && !this.wasVisible;

    /// <summary>
    ///   <para>Did this sphere change from being visible to being invisible in the most recent culling pass?</para>
    /// </summary>
    public bool hasBecomeInvisible => !this.isVisible && this.wasVisible;

    /// <summary>
    ///   <para>The current distance band index of the sphere, after the most recent culling pass.</para>
    /// </summary>
    public int currentDistance => (int) this.m_ThisState & (int) sbyte.MaxValue;

    /// <summary>
    ///   <para>The distance band index of the sphere before the most recent culling pass.</para>
    /// </summary>
    public int previousDistance => (int) this.m_PrevState & (int) sbyte.MaxValue;
  }
}
